package org.mrjbee.share.it.easy.server;

import org.restlet.resource.Get;
import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;

import com.google.appengine.api.oauth.OAuthRequestException;
import com.google.appengine.api.oauth.OAuthService;
import com.google.appengine.api.oauth.OAuthServiceFactory;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class PingResource extends ServerResource {
	
	@Get("text")
	public synchronized String getData(){
		String userName = OAuthCheker.getUserName(false);
		String answer =  "Hi,you are not allowed to use this service!";
		if (userName != null){
			answer =  "Hi, "+userName+" do you want to play ping-pong!";
		}
		return answer;
	}

}
